-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support FCM changes #5411
Support FCM changes #5411
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5411 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 504 504
Lines 25196 25204 +8
=========================================
+ Hits 25196 25204 +8 ☔ View full report in Codecov by Sentry. |
aeb11ed
to
39bf0e2
Compare
@@ -11,7 +13,15 @@ class ClaimView(ClaimViewMixin, SmartFormView): | |||
class Form(ClaimViewMixin.Form): | |||
title = forms.CharField(label=_("Notification Title")) | |||
address = forms.CharField( | |||
label=_("FCM Key"), help_text=_("The key provided on the the Firebase Console when you created your app.") | |||
label="Project ID", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced the FCM key with project ID for now, we need something unique to use ad address
temba/utils/fields.py
Outdated
@@ -387,3 +387,8 @@ def prepare_value(self, value): | |||
|
|||
def valid_value(self, value): | |||
return True | |||
|
|||
|
|||
class PrettyJSONEncoder(json.JSONEncoder): # pragma: needs cover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can go in temba.utils.json.PrettyEncoder
and does it need # pragma: needs cover
?
temba/utils/json.py
Outdated
@@ -57,6 +57,11 @@ def default(self, o): | |||
return super().default(o) | |||
|
|||
|
|||
class PrettyJSONEncoder(json.JSONEncoder): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other encoders/decoders in this file don't have JSON
in the name because we typically import this module like from temba.utils import json
label=_("FCM Key"), help_text=_("The key provided on the the Firebase Console when you created your app.") | ||
label="Key ID", | ||
help_text=_("Private Key ID"), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird.. asking them to enter the private key ID that is in the JSON below. Why not just extract it in form_valid
?
needs nyaruka/courier#762